const message = {
  success(params) {
    if(typeof params === 'string') params = { content: params }
    wx.showToast({
      title: params.content || '操作成功~',
      icon: 'success',
      duration: params.time || 1500,
      success: params.resolve
    })
  },

  error(params) {
    if(typeof params === 'string') params = { content: params }
    wx.showToast({
      title: params.content || '哪里不对了~',
      image: '../../../static/images/warning.png',
      duration: params.time || 1500,
      success: params.resolve
    })
  },

  tips(params) {
    if(typeof params === 'string') params = { content: params }
    wx.showToast({
      title: params.content || '哪里不对了~',
      icon: 'none',
      mask: true,
      duration: params.time || 1000,
      success: params.resolve
    })
  }
}

export {
  message
};
